function foo(){
  arguments.callee.before()
  console.log(111)
  arguments.callee.after()
}

foo.before = function() {
  console.log('before')
}
foo.after = function() {
  console.log('after')
}


foo();